﻿<!--#include file="const.asp"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
if sid="Null" then
	Response.Redirect "login.asp"
	Response.end
end if
IF  Request.QueryString("Action")="login" Then
	call login
else
	call index
end if
end Function



Function index
	dim page
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
	dim Runtxt,id,listid
    		listid = Request("listid")
    		If listid = "" Then listid = 0
   		If Not IsNumeric(listid) Then listid = 0
    		listid = CLng(listid)
    		If listid < 0 Then listid = 0

	Runtxt=qingtian.RunStr
    		id = Request("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 1 Then id = 1

%>
	<card title="转移帖子"><p align="left">
 
 	选择转移到的论坛:<br/>
	<%
		Dim sql1,rs1,i
		set rs1=server.CreateObject("adodb.recordset")
		sql1="select * from qingtian_bbs WHERE [del]=0 and [view]=0 and [class]=0 order by id asc"
		Rs1.Open Sql1,conn,1,1
		if not (rs1.bof and rs1.eof)  then 
			%><select name="bbsid<%=Runtxt%>" value="<%=rs1("id")%>"><%

			For i=1 to rs1.RecordCount
				If Rs1.Eof Then
					exit For
				End If
					%><option value="<%=rs1("id")%>"><%=rs1("name")%></option><%
				Rs1.MoveNext
			Next
		else
 		%><select name="bbsid<%=Runtxt%>" ><%
		end if
		Rs1.close
		set rs1=nothing
%>
	</select><br/>

	<anchor>确定提交
    	<go href="movebbslist.asp?Action=login&amp;page=<%=page%>&amp;id=<%=id%>&amp;listid=<%=listid%>&amp;sid=<%=sid%>" method='post'>
        <postfield name="bbsid" value="$(bbsid<%=Runtxt%>)"/>
    	</go>
	</anchor><br/>
-------------<br/>
<a href='bbslist.asp?page=<%=page%>&amp;listid=<%=listid%>&amp;sid=<%=sid%>'>返回帖子管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
End Function


Function login
	dim page
    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1

		dim rs,sql,errs,id,listid
    		listid = Request("listid")
    		If listid = "" Then listid = 0
   		If Not IsNumeric(listid) Then listid = 0
    		listid = CLng(listid)
    		If listid < 0 Then listid = 0

		dim bbsid
      		bbsid=Request.form("bbsid")


    		id = Request("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 1 Then id = 1

		errs=""

	if bbsid="" or Not IsNumeric(bbsid) then errs=errs&"请选择论坛<br/>"



	%>
	<card id="login" title="转移帖子" ontimer="bbslist.asp?page=<%=page%>&amp;listid=<%=listid%>&amp;sid=<%=sid%>"><timer value="20"/>
		<p align="left">
	<%
	IF len(errs)=0 then



		set rs=server.CreateObject("adodb.recordset")
		sql="select * from qingtian_bbs_forum  WHERE id="&id
		rs.open sql,conn,1,3
		if not (rs.bof and rs.eof)  then 
			rs("listid")=bbsid
		rs.update()
		end if
		Rs.close
		Set rs = Nothing
		%>转移帖子成功!<br/><%

	else%>
		<%=errs%>
		<a href="movebbslist.asp?page=<%=page%>&amp;listid=<%=listid%>&amp;id=<%=id%>&amp;sid=<%=sid%>">返回修改</a><br/>
<%	end if
%>
<a href='bbslist.asp?page=<%=page%>&amp;listid=<%=listid%>&amp;sid=<%=sid%>'>返回帖子管理</a><br/>
<a href='index.asp?sid=<%=sid%>'>后台管理首页</a><br/>
<%
end Function 


%>
